#!/bin/sh
# aria2安装
curl -O http://github.com.cnpmjs.org/aria2/aria2/releases/download/release-1.36.0/aria2-1.36.0.tar.gz
tar -zxvf aria2-1.36.0.tar.gz
cd aria2-1.36.0
./configure
make && make install
cd ..
\rm aria2-1.36.0 aria2-1.36.0.tar.gz -r

# 配置
mkdir ~/.aria2 /etc/aria2
cat /dev/null > /etc/aria2/aria2.session
curl https://gitee.com/XYLongzzZ/msh/raw/master/file/aria2.conf -o ~/.aria2/aria2.conf

# 开机启动服务
curl https://gitee.com/XYLongzzZ/msh/raw/master/file/aria2 -o /etc/init.d/aria2                   
chmod +x /etc/init.d/aria2                                                                
echo "/etc/init.d/aria2 start">> /etc/rc.local                                            
/etc/init.d/aria2 start                                                                   
iptables -A INPUT -p tcp --dport 6800 -j ACCEPT